<?php
/**
 * crpTag
 *
 * @copyright (c) 2008-2009 Daniele Conca
 * @link http://code.zikula.org/crptag Support and documentation
 * @author Daniele Conca <conca.daniele@gmail.com>
 * @license GNU/GPL - v.2.1
 * @package crpTag
 */

Loader :: includeOnce('modules/crpTag/pnclass/crpTag.php');

/**
 * the main administration function
 *
 * @return string HTML output
 */
function crpTag_admin_main()
{
	// Security check
	if (!SecurityUtil :: checkPermission('crpTag::', '::', ACCESS_EDIT))
	{
		return LogUtil :: registerPermissionError();
	}

	// Create output object
	$pnRender = new pnRender('crpTag', false);

	// Return the output that has been generated by this function
	return $pnRender->fetch('crptag_admin_main.htm');
}



/**
 * modify module configuration
 *
 * @return string HTML output string
 */
function crpTag_admin_modifyconfig()
{
	// Security check
	if (!SecurityUtil :: checkPermission('crpTag::', '::', ACCESS_EDIT))
	{
		return LogUtil :: registerPermissionError();
	}

	$tag = new crpTag();
	return $tag->modifyConfig();
}

/**
 * modify module configuration
 *
 * @return string HTML output string
 */
function crpTag_admin_updateconfig()
{
  // Security check
  if (!SecurityUtil::checkPermission('crpTag::', '::', ACCESS_EDIT)) {
      return LogUtil::registerPermissionError();
  }

  $tag = new crpTag();
	return $tag->updateConfig();
}